//
//  HAClient.m
//  HeHuangClub
//
//  Created by 张 on 2018/11/21.
//  Copyright © 2018年 pro2. All rights reserved.
//

#import "HAClient.h"

@implementation HAClient

DEF_SINGLETON(HAClient)

- (id)init
{
    self = [super init];
    if (self) {
        [self ba_netType];
    }
    return self;
}

//开启网络监听
- (void)ba_netType
{
    weakify(self);
    [BANetManager ba_startNetWorkMonitoringWithBlock:^(BANetworkStatus status) {
        strongify(self);
        if (status == BANetworkStatusNotReachable) {//没网络
            self.isHaveNetwork = NO;
            [QMUITips hideAllTips];
        }else{//有网络
            self.isHaveNetwork = YES;
        }
    }];
}

- (void)loginOut:(void (^) (void))success{
    //清除 用户 数据
    [UserDefaults setAutoLogin:NO];
    [UserDefaults setAccessToken:nil];
    [self setIsLogin:NO];
    success();
}




@end
